import csv
from dataanalysis import collect_folder

data = collect_folder("optimized_folder")
with open('test.csv', 'w+', newline='') as myFile:
    myWriter=csv.writer(myFile, )
    # writerrow一行一行写入
    myWriter.writerow(["predict_X", "predict_y", "gt_X", "gt_y"])
    # myWriter.writerow([8,'h','f'])
    # writerow多行写入
    # myList=[[1,2,3],[4,5,6]]
    myWriter.writerows(data)